import { IMapSource } from './mapTypes';

/**
 * 加载 tileserver-gl 提供的 mbtiles 作为底图
 *
 * 需启动服务： tileserver-gl
 * 例： docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl --file ./public/map/osm-2020-02-10-v3.11_china_beijing.mbtiles
 */
export const LocalMbTilesConfig: IMapSource = {
  style: 'http://localhost:8080/styles/basic-preview/style.json',
  onLoad(map: mapboxgl.Map) {
    console.log(map, 'init done');
  },
};

export const GetLocalMbTilesConfig = () => {
  return LocalMbTilesConfig;
};
